.code-container {
    background: #2d2d2d;
    color: #ccc;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    counter-reset: line;
    overflow-x: auto;
}

.code-line {
    display: block;
    padding-left: 3em;
    position: relative;
}

.code-line::before {
    counter-increment: line;
    content: counter(line);
    position: absolute;
    left: 0;
    color: #666;
    width: 2.5em;
    text-align: right;
}

.code-block-wrapper {
    height: 100%;
    position: relative;
    margin: 1em 0;

    &:hover .copy-button {
        opacity: 1;
    }
}

.copy-button {
    position: absolute;
    top: 8px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    color: #fff;

    &:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

.copy-tip {
    position: absolute;
    top: 40px;
    right: 8px;
    background: #52c41a;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    animation: fadeOut 2s forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}